import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    {
        path: "/",
        redirect: "/login"
    },
    {
        path: '/login',
        component: () => import('../view/Login.vue')
    },
    {
        path: "/betch",
        component: () => import('../view/home/Bench.vue'),
    },
    {
        path: "/attendance",
        component: () => import('../view/attendance/Attendance.vue'),
        children: [
            {
                path: "", // 默认子路由
                redirect: "/attendance/clockInOrOut"
            },
            {
                path: "clockInOrOut",
                component: () => import('../view/attendance/ClockInOrOut.vue'),
            },
            {
                path: "myRecords",
                component: () => import('../view/attendance/MyRecords.vue'),
            },
            {
                path: "othersRecords",
                component: () => import('../view/attendance/OthersRecords.vue'),
            }
        ]
    },
    {
        path: "/message",
        component: () => import('../view/message/Message.vue'),
    },
    {
        path: "/checkMessage/:id",
        component: () => import('../view/message/CheckMessage.vue'),
    },
    {
        path: "/application",
        component: () => import('../view/application/Application.vue'),
    },
    {
        path: "/applicationType",
        component: () => import('../view/application/ApplicationType.vue'),
    },
    {
        path: "/applicationRecordsList",
        component: () => import('../view/application/ApplicationRecordsList.vue'),
    },
    {
        path: "/apply/:id&:type",
        name: "apply",
        component: () => import('../view/application/Apply.vue'),
    },
    {
        path: "/applicationSingleRecord/:recordId&:empId",
        name: "applicationSingleRecord",
        component: () => import('../view/application/ApplicationSingleRecord.vue'),
    },
    {
        path: "/approval",
        component: () => import('../view/approval/Approval.vue'),
    },
    {
        path: "/approvaling/:recordId&:empId",
        name: "Approvaling",
        component: () => import('../view/approval/Approvaling.vue'),
    },
    {
        path: "/notice",
        component: () => import('../view/notice/CheckNotice.vue'),
    },
    {
        path: "/myCenter",
        component: () => import('../view/home/PersonalCenter.vue'),
    }
]


//创建路由实例
let router = createRouter({
    history: createWebHashHistory(),//路由方式 createWebHistory() 或 createWebHashHistory()
    routes: routes//注册路由规则
});


export default router;